package main

import (
	"embed"
	"uap/common"
	"uap/pkg/captcha"
	"uap/router"

	_ "uap/boot"

	"github.com/gin-gonic/gin"
)

//go:embed web/dist
var embedFrontend embed.FS //前端文件

//go:embed static/comic.ttf
var fontContent []byte //验证码字体

func main() {
	//初始化验证码功能
	captcha.Init(&fontContent)

	gin.SetMode("debug")
	r := gin.Default()
	router.InitStaticRouter(r, embedFrontend)
	r.Use(router.Cors())
	r.Use(router.ArgsFilter())
	router.InitDynamicRouter(r)
	r.Run(":" + common.Port)
}
